package people;

public class Address {

	private String street;
	private String zip;
	private String town;

	public Address(String street, String zip, String town) {
		this.street = street;
		this.zip = zip;
		this.town = town;
	}
	
	@Override
	public boolean equals(Object object) {
		if (this == object) return true;
		if (!(object instanceof Address)) return false;
		
		Address that = (Address)object;
		return this.street.equals(that.street) && 
			this.zip.equals(that.zip) &&
			this.town.equals(that.town);
	}
	
	@Override
	public int hashCode() {
		return (this.street + this.zip + this.town).hashCode();
	}

}
